<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateNoticesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('notices', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('创建人');
            $table->integer('type_id')->comment('公告类型');
            $table->string('title',100)->default('')->comment('公告标题');
            $table->text('content')->comment('公告内容');
            $table->tinyInteger('status')->comment('状态0未发送1已发送');

            $table->timestamps();
        });

        DB::statement("ALTER TABLE `notices` comment '公告表';");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('notices');
    }
}
